package com.skt.domain.DTO.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Min;
import javax.validation.constraints.Future;
import java.time.LocalDate;

/**
 * 添加到购物车请求DTO
 */
@Data
@Schema(description = "添加到购物车请求参数")
public class AddToCartRequest {

    @Schema(description = "服装ID", required = true)
    @NotNull(message = "服装ID不能为空")
    private Long costumeId;

    @Schema(description = "商家ID", required = true)
    @NotNull(message = "商家ID不能为空")
    private Long merchantId;

    @Schema(description = "数量", required = true)
    @NotNull(message = "商品数量不能为空")
    @Min(value = 1, message = "商品数量必须大于0")
    private Integer quantity;

    @Schema(description = "租赁天数", required = true)
    @NotNull(message = "租赁天数不能为空")
    @Min(value = 1, message = "租赁天数必须大于0")
    private Integer rentalDays;

    @Schema(description = "预计租赁开始日期", required = true)
    @NotNull(message = "租赁开始日期不能为空")
    @Future(message = "租赁开始日期必须是未来日期")
    private LocalDate startDate;

    @Schema(description = "预计租赁结束日期（可选，前端可根据租赁天数和开始日期自动计算）")
    private LocalDate endDate;

    @Schema(description = "是否选中：true-是，false-否", defaultValue = "true")
    private Boolean selected = true;
}